package com.hmall.api.client;


import com.hmall.api.client.fallback.ItemFallBackFatorer;
import com.hmall.api.dto.ItemDTO;
import com.hmall.api.dto.OrderDetailDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Collection;
import java.util.List;

@FeignClient(value = "item-service",fallbackFactory = ItemFallBackFatorer.class)
//fallbackFactory = ItemFallBackFatorer.class
public interface ItemClient {

    @GetMapping("/items")
    List<ItemDTO> queryItemById(@RequestParam("ids") Collection<Long> ids);
     @PutMapping("/items/stock/deduct")
    void deductStock(@RequestBody List<OrderDetailDTO> detailDTOS);
}
